package locations.actions;

import java.util.Collection;
import java.util.LinkedList;

import locations.dao.implement.PacientDAOHibernateJPA;
import locations.model.Practica;

import com.opensymphony.xwork2.ActionSupport;
import locations.model.Pacient;

public class PracticasIndexAction extends ActionSupport {

	private static final long serialVersionUID = 1L;
	private Long id;
	Collection<Practica> practicas = new LinkedList<Practica>();
        private Pacient paciente;

	public String execute() {
		PacientDAOHibernateJPA dao = new PacientDAOHibernateJPA();
                paciente = dao.retrieveById(this.getId());
		this.setPracticas(paciente.getPracticas());
		return SUCCESS;
	}

	public Collection<Practica> getPracticas() {
		return practicas;
	}

	public void setPracticas(Collection<Practica> practicas) {
		this.practicas = practicas;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

    /**
     * @return the paciente
     */
    public Pacient getPaciente() {
        return paciente;
    }

    /**
     * @param paciente the paciente to set
     */
    public void setPaciente(Pacient paciente) {
        this.paciente = paciente;
    }

}
